from src.display.gui import Gui
from src.handler.sprite import SpriteHandler

class PlayerGui(Gui):

    def __init__(self, client):
        sprite = SpriteHandler.get("gui_player")
        Gui.__init__(self, client, sprite)
        self.x = self.client.width / 2 - 150
        self.y = self.client.height - 60
        self.width = 100
        self.heigth = 100

    def render(self, data=None):
        self.client.window.surface.blit(self.surface, (self.x, self.y), (0,0,300,60))
        self.client.window.surface.blit(self.client.world.player.talent.abilities[self.client.world.player.talent.active].getSprite(), (self.x - 200, self.y))

        player = self.client.world.player
        pro = player.health / player.maxHealth
        self.client.window.surface.blit(self.surface, (self.x + 14, self.y + 11), (0, 60, 270 * pro, 15))